<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="__CSS__/style_forum.css">
	<link rel="stylesheet" href="__CSS__/style_post.css">
	<link rel="stylesheet" href="__CSS__/reset.css">
	<title>发帖 - ThinkPHP</title>
	<script type="text/javascript" src="__JS__/jquery-3.4.1.min.js"></script>
	<script type="text/javascript" src="__JS__/loadinghtml.js"></script>
	<script type="text/javascript" src="__JS__/DropDown.js"></script>
	<script type="text/javascript">
		function secdefault(sid) {
			var sec = document.getElementById('section');
			var opt = sec.getElementsByTagName("option")[sid];
			opt.selected = true;
		}
		function check() {
			var inputFile = document.getElementById("section").value;
			if (inputFile!=0) {
				return true;
			} else {
				alert("请先选择版块再提交");
				return false;
			}
		}
	</script>
</head>
<body onload="secdefault({$s_id});">
	<div id="header" class="top">
		<div id="hd-main">
			<a id="alink" href="{:url('index/index')}" title="返回首页"></a>
			<ul id="main-nav">
				<li><a href="{:url('index/index')}">首页</a></li>
				<li style="background-color: #656565" id="triggerdown">
					<a href="{:url('index/view',['s_id'=>0,'ot'=>'m_createat'])}">论坛</a>
					<ul id="dropdown">
						<li><a href="{:url('index/view',['s_id'=>0,'ot'=>'m_createat'])}">全部</a></li>
						{volist name="sec" id="secRow"}
						<li><a href="{:url('index/view',['s_id'=>$secRow.s_id,'ot'=>'m_createat'])}">{$secRow.s_name}</a></li>
						{/volist}
					</ul>
				</li>
				<li><a href="{:url('index/pa')}">修改密码</a></li>
				<li><a href="{:url('index/me')}">上传头像</a></li>
				<li><a href="{:url('user/login')}">登录</a></li>
				<li><a href="{:url('user/reg')}">注册</a></li>
				<li><a href="{:url('index/logout')}">退出</a></li>
				<li><a href="{:url('user/contact')}">联系我们</a></li>
			</ul>
			<div id="header-bar">
				<h3>欢迎你，{:session('user')}</h3>
				<div id="userloginmes">
					<a href="" id="unlogin">
						<img src="__POT__/{:session('uimg')}" width="24px" height="24px">
					</a>
					<ul>
						<li><a href="{:url('index/collect')}">我的收藏</a></li>
						<li><a href="{:url('index/logout')}">退出</a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<div id="main">
		<form id="think-form" action="{:url('index/doPost',['s_id' => $s_id])}" method="post" onsubmit="javascript:return check();">
			<div id="main-hd">
				<div class="avatar"><img src="__POT__/{:session('uimg')}" width="44px" height="44px"></div>
				<div id="hd-info">
					<strong>{:session('user')}</strong>
					<span id="time">{:date("Y-m-d H:i")}</span>
				</div>				
				<span id="hd-title">发布新话题</span>
			</div>
			<table>
				<tr>
					<th><i class="must">*</i>标题</th>
					<td><input type="text" class="text" name="mtitle"></td>
				</tr>
				<tr>
					<th><i class="must">*</i>分类</th>
					<td>
						<select name="sid" id="section">
							<option value="0">选择分类</option>
							{volist name="sec" id="secRow"}
							<option value="{$secRow.s_id}">{$secRow.s_name}</option>
							{/volist}
						</select>
					</td>
				</tr>
				<tr>
					<th><i class="must">*</i>内容</th>
					<td><textarea name="mcontent" id="" cols="30" rows="10"></textarea></td>
				</tr>
				<tr><th>标签</th><td><input type="text" class="text"></td></tr>
				<tr><th>附件</th><td><input type="file"></td></tr>
				<tr><th>&nbsp;</th><td><input type="submit" id="submit"></td></tr>
			</table>
		</form>
		<div id="prompt">
			<div id="ptitle">
				<h4>发布话题</h4>
			</div>
			<ul>
				<li>请完整输入话题的标题和内容，并选择恰当的分类</li>
				<li>标签是可选项，多个标签使用空格分隔</li>
			</ul>
		</div>
	</div>
	<div id="footer"></div>
</body>
</html>